#ifndef _APP_OSD_H_
#define _APP_OSD_H_

#include "md_OSD.h"

//void Test(void)reentrant;
void TWLL_OSDLayer_Init(void);
void TWLL_WaitOSDBlank(U8 Cnt);
void TWLL_WaitDisplayBlank(U8 Cnt);
#ifdef Used_BlockTransfer
void TWLL_BlockTransfer(U16 sx, U16 sy, U16 w, U16 h, U16 dx, U16 dy,U8 DispMode)reentrant;
#endif
#if 0//erek 2011-1-26 for bank overflow issue
#ifdef Update_AvoidBlink 
void TWLL_UpdateButton_WithBT(U16 Ctrl);
void TWLL_UpdateProgressBar_WithBT(U16 Ctrl);
#endif
#endif
void TWLL_SetWin_GlobalAlpha(U8 WinNO, U8 alpha_level);
void TWLL_Canvas_Init(CANVAS* pCanvas);
void TWLL_Canvas_OnOff(U8 CanNO, U8 OnOff );
#ifndef DP80390
void TWLL_Load_AllScratch_page( void)reentrant;
void TWLL_Load_PerScratch_page( U8 ScratchNO)reentrant;
#endif
void TWLL_Canvas_Pallette_Set(U8 canvas_id, U8 pal_id);
void TWLL_Icon_Create(U16 UICtrlID, UIControlIcon_struct * UIIcon);
void TWLL_String_Create(U16 UICtrlID, UIControlString_struct *UIString);
void TWLL_Rect_Create(U16 UICtrlID, UIControlRect_struct *UIRect);
#ifndef DP80390
void TWLL_Line_Create(U16 UICtrlID, UIControlLine_struct * UILine)reentrant;
void TWLL_Icon_Redraw(U16 UICtrlID, UIControlIcon_struct * UIIcon)reentrant;
void TWLL_String_Redraw(U16 UICtrlID, UIControlString_struct *UIString)reentrant;
void TWLL_Rect_Redraw(U16 UICtrlID, UIControlRect_struct *UIRect)reentrant;
void TWLL_Line_Redraw(U16 UICtrlID, UIControlLine_struct * UILine)reentrant;
#endif
void TWLL_Icon_Remove(U16 UICtrlID, UIControlIcon_struct * UIIcon);
void TWLL_String_Remove(U16 UICtrlID, UIControlString_struct *UIString);
#ifndef DP80390
void TWLL_Rect_Remove(U16 UICtrlID, UIControlRect_struct *UIRect)reentrant;
void TWLL_Line_Remove(U16 UICtrlID, UIControlLine_struct * UILine)reentrant;
#endif
void TWLL_Get_CharSize(U16 Font_index, U8 *width, U8* height)reentrant;
void TWLL_Get_TextSize(UIControlString_struct *UIString, U16 *width, U16 *height)reentrant;
U16 TWLL_Get_ImageID(U16 UICtrlID, UIControlIcon_struct * UIIcon)reentrant;
void TWLL_Get_ImageSize(U16 imageid, U16 * pw, U16 *ph)reentrant;

U8 TWLL_Get_ImageCanvas(U16 UICtrlID, UIControlIcon_struct * UIIcon)reentrant;//erek 2011-1-26 for bank overflow issue
void TWLL_Get_IconShowOnCanvasXY(U16 UICtrlID, UIControlIcon_struct * UIIcon, U16 * X, U16 *Y)reentrant;//erek 2011-1-26 for bank overflow issue

void Draw_DialString(U16 Number,U8 Count,U16 Value);//erek 2011-1-26 for bank overflow issue



void ZPrintf_XY(U16 x, U16 y, U16 B_Color, U16 F_Color,U8 Canvas_ID, const char *fmt, ... );
void ZPrintf_XY_8Bit(U16 x, U16 y, U8 B_Color, U8 F_Color,U8 Canvas_ID, const char *fmt, ... );

#if 0
void ZPrintf(U16 * buf, const char *fmt, ...);
#endif
void ZPrintf(U16 Number,const char *fmt, ...);//erek 2011-1-26 for bank overflow issue

void ZPrintf_Unicode(U16 x, U16 y, U16 B_Color, U16 F_Color,U8 Canvas_ID, U16 UnicodeNum);
void ZPrintf_Unicode_8Bit(U16 x, U16 y, U8 B_Color, U8 F_Color,U8 Canvas_ID, U16 UnicodeNum);


#endif
